package kassiopeia.plugin.crawler.processor.config;

import com.thoughtworks.xstream.XStream;

import java.io.InputStream;

public class Serializer {
    private static XStream xstream;

    static {
        xstream = new XStream();
        xstream.processAnnotations(new Class[] {Configuration.class, Item.class});
    }

    public static Configuration fromXML(InputStream xml) {
        return (Configuration) xstream.fromXML(xml);
    }

    public static String toXML(Configuration config) {
        return xstream.toXML(config);
    }
}
